package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import expression.InfixtoPostfixTranslator;

public class WilliamFoleyIPTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		String answer = InfixtoPostfixTranslator.eval("5 + 5");
		assertTrue(answer.equals("5 5 +"));
	}
	@Test
	public void test2() {
		String answer = InfixtoPostfixTranslator.eval("5 - 5");

		assertTrue(answer.equals("5 5 -"));
	}
	
	@Test
	public void test3() {		
		String answer = InfixtoPostfixTranslator.eval("2 * ( 5 + 5 )");
		assertTrue(answer.equals("2 5 5 + *"));
	}
	
	@Test
	public void test4() {		
		String answer = InfixtoPostfixTranslator.eval("2 * 5 + 5");
		assertTrue(answer.equals("2 5 * 5 +"));
	}
	
	@Test
	public void test5() {		
		String answer = InfixtoPostfixTranslator.eval("( 5 ^ 2 ) / 5");
		assertTrue(answer.equals("5 2 ^ 5 /"));
	}
	
	@Test
	public void test6() {		
		String answer = InfixtoPostfixTranslator.eval("10 / ( 5 - 3 )");
		assertTrue(answer.equals("10 5 3 - /"));
	}
	
	@Test
	public void test7() {
		String answer = InfixtoPostfixTranslator.eval("10     / (    5 -  3    )");
		assertTrue(answer.equals("10 5 3 - /"));
	}

}
